<html>
<head><meta charset="utf-8"><title>ergonomic use of pin · wg-async-foundations · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/index.html">wg-async-foundations</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ergonomic.20use.20of.20pin.html">ergonomic use of pin</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="245495123"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/ergonomic%20use%20of%20pin/near/245495123" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ergonomic.20use.20of.20pin.html#245495123">(Jul 09 2021 at 20:41)</a>:</h4>
<p>I had thought at some point about trying to make Pin more ergonomic to use</p>



<a name="245495205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/ergonomic%20use%20of%20pin/near/245495205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ergonomic.20use.20of.20pin.html#245495205">(Jul 09 2021 at 20:42)</a>:</h4>
<p>I kind of stopped thinking as much about it as much since I think we really do want the ability to have scoped threads and guaranteed poll-to-completion</p>



<a name="245495259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/ergonomic%20use%20of%20pin/near/245495259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ergonomic.20use.20of.20pin.html#245495259">(Jul 09 2021 at 20:42)</a>:</h4>
<p>but e.g. you could imagine finding ways to overload <code>&amp;mut</code> so that you can just do <code>&amp;mut foo.bar</code> where <code>foo: PIn&lt;impl DerefMut&gt;</code> or something.</p>



<a name="245495305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/ergonomic%20use%20of%20pin/near/245495305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ergonomic.20use.20of.20pin.html#245495305">(Jul 09 2021 at 20:43)</a>:</h4>
<p>(presumably some more trait stuff is needed to make that really work)</p>



<a name="245495349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/ergonomic%20use%20of%20pin/near/245495349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ergonomic.20use.20of.20pin.html#245495349">(Jul 09 2021 at 20:43)</a>:</h4>
<p>similarly I do wonder if there'd be a way to make it so that you don't have to write <code>pin!(x)</code> to force something to be immovable</p>



<a name="245495361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/ergonomic%20use%20of%20pin/near/245495361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ergonomic.20use.20of.20pin.html#245495361">(Jul 09 2021 at 20:43)</a>:</h4>
<p>if we baked it a bit more into the language</p>



<a name="245495440"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/ergonomic%20use%20of%20pin/near/245495440" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ergonomic.20use.20of.20pin.html#245495440">(Jul 09 2021 at 20:44)</a>:</h4>
<p>actually I'm going to break this out into its own topic</p>



<a name="245495490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/ergonomic%20use%20of%20pin/near/245495490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ergonomic.20use.20of.20pin.html#245495490">(Jul 09 2021 at 20:44)</a>:</h4>
<p>I wouldn't mind having a new kind of reference for such things.</p>



<a name="245495494"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/ergonomic%20use%20of%20pin/near/245495494" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ergonomic.20use.20of.20pin.html#245495494">(Jul 09 2021 at 20:44)</a>:</h4>
<p>I am thinking about this a bit now-- given that <code>Pin</code> <em>is</em> useful in a lot of areas, and may indeed be the right way to handle <span class="user-mention" data-user-id="239881">@Josh Triplett</span>'s "pointer to field" example, maybe it's worth diving a bit more into why it's hard for folks to use</p>



<a name="245495522"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/ergonomic%20use%20of%20pin/near/245495522" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ergonomic.20use.20of.20pin.html#245495522">(Jul 09 2021 at 20:45)</a>:</h4>
<p>and what could be done about it</p>



<a name="245495568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/ergonomic%20use%20of%20pin/near/245495568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ergonomic.20use.20of.20pin.html#245495568">(Jul 09 2021 at 20:45)</a>:</h4>
<p>I'm a bit reluctant to add a new kind of reference</p>



<a name="245495577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/ergonomic%20use%20of%20pin/near/245495577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ergonomic.20use.20of.20pin.html#245495577">(Jul 09 2021 at 20:45)</a>:</h4>
<p>but it's not totally unreasonable</p>



<a name="245495653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/ergonomic%20use%20of%20pin/near/245495653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ergonomic.20use.20of.20pin.html#245495653">(Jul 09 2021 at 20:46)</a>:</h4>
<p>I guess the place to start is to reread the faster than lime post</p>



<a name="245495660"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/ergonomic%20use%20of%20pin/near/245495660" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ergonomic.20use.20of.20pin.html#245495660">(Jul 09 2021 at 20:46)</a>:</h4>
<p>and just imagine where it could go differently</p>



<a name="246042133"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/ergonomic%20use%20of%20pin/near/246042133" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ergonomic.20use.20of.20pin.html#246042133">(Jul 15 2021 at 01:35)</a>:</h4>
<p>I think pin projection is a big pain point -- if we could bake this in or make it less painful somehow, it would be very helpful</p>



<a name="246042195"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/ergonomic%20use%20of%20pin/near/246042195" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ergonomic.20use.20of.20pin.html#246042195">(Jul 15 2021 at 01:36)</a>:</h4>
<p>I also think the Pin docs need to be rewritten (and I know someone who's working on this)</p>



<a name="246042229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/ergonomic%20use%20of%20pin/near/246042229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/ergonomic.20use.20of.20pin.html#246042229">(Jul 15 2021 at 01:37)</a>:</h4>
<p>if we could have some kind of <code>pin</code> binding modifier in the language, it would be nice too</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>